<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="m" uri="/cutm_tags"%>
<html>
<head>
<title>稿件打分</title>
<link rel="stylesheet" href="<s:url value="/common/css/datepicker.css"/>" type="text/css" />
<script type="text/javascript" src="<s:url value="/common/script/ui.datepicker.js"/>"></script>
<script type="text/javascript" src="<s:url value="/common/script/ui.datepicker-fr.js"/>"></script>
<script type="text/javascript">
$(document).ready(function() {
	$("#editForm").vaildAjax(function(data){
		alert('保存成功！');
		BaseJs.setReadonly();
		$('#btn').hide();
	});
	if('<s:property value="searchManuscriptModel.ubeginDate"/>'==null || '<s:property value="searchManuscriptModel.ubeginDate"/>'=="") {
		$("input[name='searchManuscriptModel.ubeginDate']").val("");
	}
	if('<s:property value="searchManuscriptModel.uendDate"/>'==null || '<s:property value="searchManuscriptModel.uendDate"/>'=="") {
		$("input[name='searchManuscriptModel.uendDate']").val("");
	}
});
//提交
function commit(){
	if(BaseJs.confirm('确定要提交吗？')){
		var contentInfo = '';
		$('.content').each(function(){
			var voId = $(this).find('.voId').val();
			var level = $(this).find('.level option:selected').val();
			var puserScore = $(this).find('.puserScore option:selected').val();
			var auditScore = $(this).find('.auditScore option:selected').val();
			contentInfo += voId+','+level+','+puserScore+','+auditScore+';';
		});
		$('#contentInfo').val(contentInfo);
		//alert('contentInfo:'+contentInfo);
		$('#editForm').submit();
	}
}
</script>
</head>
<body>
<h2 class="title"><span>稿件打分</span></h2>
<s:form id="serchForm" action="programming/SearchProgram!searchManuscript" onsubmit="return true">
	<h3>请输入查询条件</h3>
	<table id="sTable" class="form">
		<tbody>
			<tr>
				<th width="10%">记者</th>
				<td width="15%"><m:dropUser name="searchManuscriptModel.userId" headValue="" headKey="--请选择--" /></td>
				<th width="10%">报播栏目</th>
				<td width="15%"><m:select enumType="program.type" name="searchManuscriptModel.column" headKey="--请选择--"
					headValue="0" /></td>
				<th width="10%">撰稿日期</th>
				<td width="40%"><m:date name="searchManuscriptModel.beginDate" maxDate="0" />-<m:date name="searchManuscriptModel.endDate"
					maxDate="0" /></td>
			</tr>
			<tr>
				<th>关键字</th>
				<td colspan="3"><s:textfield maxlength="50" name="searchManuscriptModel.title" /></td>
				<th>使用日期</th>
				<td><m:date name="searchManuscriptModel.ubeginDate" maxDate="0" />-<m:date name="searchManuscriptModel.uendDate"
					maxDate="0" /></td>
			</tr>
		</tbody>
	</table>
	<div class="btnGroup"><s:submit id="search" value="查询" /></div>
</s:form>
<h3>稿件列表</h3>
<s:form id="editForm" action="programming/EditProgram!editGrade">
	<s:hidden name="contentInfo" id="contentInfo" />
	<table class="list">
		<thead>
			<tr>
				<th width="5%">序号</th>
				<th width="15%">标题</th>
				<th width="8%">撰稿日期</th>
				<th width="8%">录用日期</th>
				<th width="10%">记者</th>
				<th width="7%">等级</th>
				<th width="7%">配音人员</th>
				<th width="7%">配音长度</th>
				<th width="7%">配音分数</th>
				<th width="7%">文稿编辑</th>
				<th width="7%">编辑分数</th>
				<th width="7%">报播次数</th>
				<th width="5%">操作</th>
			</tr>
		</thead>
		<tbody>
			<s:iterator value="gradeManuscriptModels" status="aa">
				<tr id="${id}" class="content">
					<td><s:property value="#aa.index+1" /></td>
					<td><s:hidden name="manuscript.id" cssClass="voId" /> <s:property value="manuscript.title" /></td>
					<td><s:date name="manuscript.createDate" format="yyyy-MM-dd HH:mm" /></td>
					<td><s:date name="manuscript.usedDate" format="yyyy-MM-dd" /></td>
					<td><s:property value="userName" /></td>
					<td><m:select enumType="start.type" name="manuscript.level" cssClass="level" /></td>
					<td><s:property value="manuscript.puser.name" /></td>
					<td><s:property value="manuscript.timeLong" />秒</td>
					<td><m:select name="manuscript.puserScore" cssClass="puserScore" enumType="score" /></td>
					<td><s:property value="auditName" /></td>
					<td><m:select name="auditScore" cssClass="auditScore" enumType="score" /></td>
					<td><a title="详细信息" href="../programming/SearchProgram!getProgrammingsByMans.action?manusId=${manuscript.id}"  target="_blank"><s:property value="manuscript.times" /></a></td>
					<td><m:imgA img="view" msg="查看信息"
						action="manuscript/EditManuscript!toEdit?readOnly=true&manuscript.id=${manuscript.id}" /></td>
				</tr>
			</s:iterator>
		</tbody>
	</table>
	<div class="btnGroup"><input value="保存" type="button" id="btn" onclick="commit()"></div>
</s:form>
</body>
</html>